<%@include file="/WEB-INF/common/taglibs.jsp"%>
<script type="text/javascript"
	src="${ctx}/resources/js/datatable-query.js"></script>
<div class="row-fluid">
	<div class="span12">
		<div class="row-fluid">
			<form class="span12 filterValidate" method="post">
				<div class="box">
					<div class="title">
						<h4>
							<span class="icon16 icomoon-icon-filter"></span> <span>Filter</span>
								<span class="box-form right"> 
							<button class="btn btn-mini">Generate</button>
							</span>
							
						</h4>
						<a href="#" class="minimize">Minimize</a>
					</div>
					<div class="content clearfix form-horizontal">
						<div class="form-row row-fluid">
							<div class="span3">
								<label class="form-label span6">Start Date</label> <input name="from"
									class="span6   datepicker" type="text" field="day" value="<fmt:formatDate pattern="yyyy-MM-dd" value="${fromTo.from}" />" />
							</div>
							<div class="span3">
								<label class="form-label span6">End Date</label> <input
									class="span6   datepicker" name="to" type="text" value="<fmt:formatDate pattern="yyyy-MM-dd" value="${fromTo.to}" />"  />
							</div>
						</div>


					</div>
				</div>
			</form>
		</div>
<c:forEach var="entity" items="${facilitySortReports}" varStatus="status">
<c:if test="${status.index % 2 == 0 }">
<div class="row-fluid">
</c:if>
		<div class="span6">
		<div class="box gradient">
			<div class="title">
				<h4>
					<span>Top </span> <span> ten </span><span> User for ${entity.facilitySort.facilityType} </span>
				</h4>
				<a href="#" class="minimize"></a>
			</div>
							<div class="content scrollable clearfix">
					<table class="display table table-bordered">
						<thead>
							<tr>
								<th>UserName</th>
								<th>Count</th>
							</tr>
						</thead>
						
						<tbody>
						<c:forEach  items="${entity.userUsages}" var="userUsage">
								<tr>
								<td>${userUsage.memberName }</td>
								<td>${userUsage.count }</td>
								</tr>
						</c:forEach>
						</tbody>
						<tfoot>
						<tr>
						<td colspan="2">Total booked ${entity.totalBook}</td>
						</tr>
						</tfoot>
					</table>
				</div>
			
</div>
</div>			
<c:if test="${status.index % 2 == 1 }">
</div>
</c:if>
<c:if test="${status.count %2 ==1 && status.last}">
</div>
</c:if>
</c:forEach>

<div class="row-fluid">
		<div class="span6">
		<div class="box gradient">
			<div class="title">
				<h4>
					<span>Top </span> <span> ten </span><span> User for All </span>
				</h4>
				<a href="#" class="minimize"></a>
			</div>
							<div class="content scrollable clearfix">
					<table class="display table table-bordered">
						<thead>
							<tr>
								<th>UserName</th>
								<th>Count</th>
							</tr>
						</thead>
						
						<tbody>
						<c:forEach  items="${allFacilitySortReport.userUsages}" var="userUsage">
								<tr>
								<td>${userUsage.memberName }</td>
								<td>${userUsage.count }</td>
								</tr>
						</c:forEach>
						</tbody>
						<tfoot>
						<tr>
						<td colspan="2">Total booked ${allFacilitySortReport.totalBook}</td>
						</tr>
						</tfoot>
					</table>
				</div>
			
</div>
</div>			

</div>

</div>
		</div>
